<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="../../jquery-easyui-1.3.6/themes/default/easyui.css" type="text/css"></link>
    <link rel="stylesheet" href="../../css/icons/icon.css" type="text/css"></link>
	<link rel="stylesheet" type="text/css" href="../demo.css"></link>
	<script type="text/javascript" src="../../jquery-easyui-1.3.6/jquery.min.js"></script>
    <script type="text/javascript" src="../../jquery-easyui-1.3.6/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../jquery-easyui-1.3.6/locale/easyui-lang-zh_CN.js"charset="utf-8"></script>
</head>
<body>
	<table id="dg" class="easyui-datagrid" title="" fit="true" border="false" style="width:100px;height:521px"
			data-options="rownumbers:true,singleSelect:false,pagination:true,url:'accessory.json',method:'get'">
		<thead>
			<tr>
				<th data-options="field:'ac_code',width:100">配件编号</th>
				<th data-options="field:'ac_name',width:150">配件名称</th>
				<th data-options="field:'price',width:80,align:'center'">单价</th>
				<th data-options="field:'purchase_num',width:80,align:'center'">购入总数</th>
				<th data-options="field:'now_num',width:80,align:'center'">现有数量</th>
				<th data-options="field:'get_ac_num',width:80,align:'center'">领用数量</th>
				<th data-options="field:'get_ac_date',width:100">领用时间</th>
				<th data-options="field:'get_ac_person',width:80">领用人</th>
				<th data-options="field:'get_ac_remark',width:150">领用备注</th>
			</tr>
		</thead>
	</table>
	<script type="text/javascript">
		$(function(){
			var pager = $('#dg').datagrid().datagrid('getPager');	// get the pager of datagrid
			pager.pagination({
				buttons:[{
				    text:'添加配件',
					iconCls:'icon-add',
					handler:function(){
						alert('add');
					}
				},'-',{
				    text:'修改配件',
					iconCls:'icon-edit',
					handler:function(){
						alert('edit');
					}
				},'-',{
				    text:'删除配件',
					iconCls:'icon-cancel',
					handler:function(){
						alert('delete');
					}
				}]
			});			
		})
	</script>
</body>
</html>